function categoryFormElement(record) {
	var formCategories = new Array();
	for(var i in record.data.categories) {
		switch(record.data.categories[i].catType) {
			case 'I': {
				formCategories.push({
					xtype: 'numberfield',
					allowDecimals: false,
					fieldLabel: record.data.categories[i].catName,
					name: 'cat_' + i,
					value: record.data.categories[i].val,
					allowBlank: true,
					anchor:'100%'
				});
			} break;
			case 'T': {
				formCategories.push({
					fieldLabel: record.data.categories[i].catName,
					xtype: 'htmleditor',
					allowBlank: true,
					enableColors: true,
					enableLinks: true,
					enableFont: false,
					enableSourceEdit: true,
					name: 'cat_' + i,
					anchor:'100%',
					height: 150,
					value: record.data.categories[i].val
				});
			} break;
			case 'C': {
				formCategories.push({
					fieldLabel: record.data.categories[i].catName,
					name: 'cat_' + i,
					value: record.data.categories[i].val,
					maxLength: 255,
					maxLengthText: 'Too long!',
					allowBlank: true,
					anchor:'100%'
				});
			} break;
			case 'L': {
				formCategories.push({
					xtype: 'combo',
					fieldLabel: record.data.categories[i].catName,
					hiddenName: 'cat_' + i,
					store: new Ext.data.ArrayStore({
						fields: ['cat_id', 'cat_name'],
						url: '<?=site_url()?>admin/getCatList/' + record.data.categories[i].catList,
						autoLoad: true
					}),
					valueField:'cat_name',
					displayField:'cat_name',
					triggerAction: 'all',
					mode: 'local',
					triggerAction: 'all',
					emptyText:'...',
					selectOnFocus:true,
					hiddenValue: record.data.categories[i].val,
					allowBlank: true,
					value: record.data.categories[i].val,
					anchor:'100%'
				})
			}  break;
		};
	}

	return formCategories;
}